package cn.study.concurrenthashmap.otherconcurrent;

import java.util.concurrent.ConcurrentSkipListMap;

public class ConcurrentSkipListMapExample {
    public static void main(String[] args) {
        ConcurrentSkipListMap<Integer, String> map = new ConcurrentSkipListMap<>();

        // 添加一些元素
        map.put(1, "one");
        map.put(2, "two");
        map.put(3, "three");

        // 访问元素
        System.out.println("Element with key 2: " + map.get(2));

        // 导航方法
        System.out.println("First Entry: " + map.firstEntry());
        System.out.println("Last Key: " + map.lastKey());
        System.out.println("Head Map (keys less than 3): " + map.headMap(3));
    }
}
